<?php $this->_extends('../_layouts/default_layout'); ?>
<?php $this->_block('contents'); ?>
<link type="text/css" href="<?=Q::ini('custom_system/base_url')?>css/jq.autocomplete.css" rel="stylesheet" />
<link type="text/css" href="<?=Q::ini('custom_system/base_url')?>css/prettyphoto.css" rel="stylesheet" />
<script type="text/javascript" src="<?=Q::ini('custom_system/base_url')?>js/jq.autocomplete.js"></script>
<script type="text/javascript" src="<?=Q::ini('custom_system/base_url')?>js/jq.mselect.old.js"></script>
<script type="text/javascript" src="<?=Q::ini('custom_system/base_url')?>js/xheditor/xheditor.js"></script>
<script type="text/javascript" src="<?=Q::ini('custom_system/base_url')?>js/jq.prettyphoto.js"></script>
<script type="text/javascript">
$(function(){
	$("a[rel^='pretty_photo']").prettyPhoto({theme:'facebook'});
	var website_categories_data = <?=isset($website_categories) ? $website_categories : '[]'?>;
	$(document).mselect(website_categories_data, ['website_id','website_cat_1','website_cat_2','website_cat_3'], ['','','',''], <?=isset($default) ? $default : '[]'?>);
	$("#website_id").attr("disabled", true);
});
</script>
<form action="<?=url('Online::Zencart/EditSave')?>" method="post">
<table class="form_table">
<tr>
	<th>产品编号</th>
	<td>
		<?=isset($product_info['number']) ? $product_info['number'] : ''?>
		<input type="hidden" name="id" value="<?=isset($product_info['id']) ? $product_info['id'] : '';?>" />
	</td>
</tr>
<tr>
	<th>标题名称</th>
	<td><input type="text" name="title" size="80" value="<?=isset($product_info['title']) ? htmlspecialchars($product_info['title']) : ''?>" /></td>
</tr>
<tr>
	<th>产品分类</th>
	<td>
		<select id="website_id"></select>
		<select id="website_cat_1" name="website_cat_1"></select>
		<select id="website_cat_2" name="website_cat_2"></select>
		<select id="website_cat_3" name="website_cat_3"></select>
	</td>
</tr>
<tr>
	<th>图片</th>
	<td>
		<?if (isset($product_info['pic_url']) && $product_info['pic_url']):?>
			<?$pretty_photo_number = 0;?>
			<?foreach ($product_info['pic_url'] as $p):?>
			<a rel="pretty_photo[1]" href="<?=$p?>"><?if(!$pretty_photo_number):?><img width="100" src="<?=$p?>" /><?endif;?></a>
			<?$pretty_photo_number = 1;?>
			<?endforeach;?>
		<?endif;?>
	</td>
</tr>
<tr>
	<th>产品描述</th>
	<td><textarea rows="10" cols="110" class="xheditor {tools:'Blocktag,Fontface,FontSize,Bold,Italic,Underline,Strikethrough,FontColor,BackColor,Removeformat,Align,List,Outdent,Indent,Link,Unlink,Img,Flash,Table,Source,Fullscreen'}" name="description"><?=isset($product_info['description']) ? $product_info['description'] : ''?></textarea></td>
</tr>
<tr>
	<th>价格</th>
	<td><input type="text" name="price" value="<?=isset($product_info['price']) ? sprintf('%.2f',$product_info['price']) : ''?>" /></td>
</tr>
<tr>
	<th>库存</th>
	<td><input type="text" name="storage" value="<?=isset($product_info['storage']) ? $product_info['storage'] : ''?>" /></td>
</tr>
<tr>
	<td></td>
	<td><input type="submit" class="button" value="保存" /></td>
</tr>
</table>
</form>
<?php $this->_endblock();?>